import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-value-binding',
  templateUrl: './value-binding.component.html',
  styleUrls: ['./value-binding.component.css']
})
export class ValueBindingComponent implements OnInit {

  public imgsrc:string = '../assets/imgs/1.jpg';

  constructor() { }

  ngOnInit() {
  }

  public changeSrc(event):void{
    console.log(event);
    let ranNum:number = Math.ceil(Math.random()*10000);
    if(ranNum%2 == 0){
        this.imgsrc = '../assets/imgs/1.jpg';
    }else{
        this.imgsrc = '../assets/imgs/2.jpg';
    }
  }

}
